package com.aaa.ssm.service.impl;

import com.aaa.ssm.dao.ScenicDotDao;
import com.aaa.ssm.entity.ScenicDot;
import com.aaa.ssm.service.ScenicDotService;
import com.aaa.ssm.util.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * @ fileName:ScenicDotServiceImpl
 * @ description:
 * 景点
 * @ date: 2023/3/29 14:42
 * @ version:1.0.0
 */
@Service
public class ScenicDotServiceImpl implements ScenicDotService {
    @Resource
    private ScenicDotDao scenicDotDao;

    @Override
    public List<ScenicDot> queryAll() {
        return scenicDotDao.queryAll();
    }
    @Override
    public PageInfo queryPage(Page<ScenicDot> page) {
        PageHelper.startPage(page.getPageNo(), page.getPageSize());
        return new PageInfo(scenicDotDao.queryByParam(page.getData()));
    }

    @Override
    public int add(ScenicDot scenicDot) {
        return scenicDotDao.add(scenicDot);
    }

    @Override
    public int update(ScenicDot scenicDot) {
        return scenicDotDao.update(scenicDot);
    }

    @Override
    public int deleteById(int id) {
        return scenicDotDao.deleteById(id);
    }
}
